package toDoList.Models;

import java.io.*;
import java.util.*;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.android.maps.GeoPoint;

public class ToDoItemModel{

	private UUID toDoItemGUID;
	private long startDateTime;
	private UUID catGUID;
	private UUID userGUID;
	private String checked;
	//private Date endDateTime;
	private String name;
	private String description;
	//private boolean recurring;
	//private int recurTimeFrame;
	//private RecurType recurType;
	private boolean isDirty;
	private GeoPoint location;
	
	
	public ToDoItemModel(String name, String desc, long startDate, String catGUID, String userGUID, String todoitemGUID, String checked, String location)
	{
		this.name = name;
		this.description = desc;
		this.startDateTime = startDate;
		this.catGUID = UUID.fromString(catGUID);
		this.userGUID = UUID.fromString(userGUID);
		this.toDoItemGUID = UUID.fromString(todoitemGUID);
		this.checked = checked;
		
		String[] latlong = location.split(",");
		this.location = new GeoPoint(Integer.parseInt(latlong[0]), Integer.parseInt(latlong[1]));
	}
	
	public boolean save() {
		throw new UnsupportedOperationException("The method is not implemented yet.");
	}

	public boolean load() {
		throw new UnsupportedOperationException("The method is not implemented yet.");
	}

	public boolean isValid() {
		throw new UnsupportedOperationException("The method is not implemented yet.");
	}
	
	@Override
	public String toString()
	{
		return this.name;
	}

	public UUID getGUID() {
		return toDoItemGUID;
	}
	
	public GeoPoint getLocation()
	{
		return location;
	}

	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	public void writeToParcel(Parcel arg0, int arg1) {
		// TODO Auto-generated method stub
		
	}
	
	public String getName()
	{
		return name;
	}
	
	public String getDescription()
	{
		return description;
	}
	
	public boolean isChecked()
	{
		if(checked.equals("true"))
		{
			return true;
		}
		else
		{
			return false;
		}
	}

}
